package sale

import (
	"dhfshop/models/sale"
	"dhfshop/controllers/base"
)

// 销售标签管理
type SaleTagController struct {
	base.BaseController
}

func (this *SaleTagController) SaleTagsList() {
	query,_,fields,order_by,offset,limit,err := this.GetQueryPara()
	if err != nil {
	   this.ServeError(err.Error())
	   return
	}
	l, cnt, err := sale.GetAllSaleTags("","",query,fields,order_by,offset,limit)
	if err != nil {
	    this.ServeError(err.Error())
	    return
	}
		r := struct {
		    TotalCount  int64               `json:"total_count"`
	        SaleTags   []*sale.SaleTag  `json:"sale_tags"`
	    }{TotalCount: cnt, SaleTags: l}
	    this.Data["json"] = r
	this.ServeJSON()
}

